package com.qianshuiting.tools;

import java.util.Scanner;

public class ToLineDate {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String ans = "";
		while(true) {
			String s = sc.nextLine();
			if (s.trim().length() == 3) {
				ans = "";
				continue;
			}
			ans += " ";
			if (ans.length() > 30) ans = ans.substring(30,ans.length());
			for (int i = 0; i < s.length(); ++i) {
				char a = s.charAt(i);
				if (a == '+' || a == '-' || (a >= '0' && a <= '9')) {
					ans += a;
				}
				System.out.println(ans);
			}
 		}
	}

}
